import { Get, Post, PostJson } from './request';

interface IUser {
    user_name: string | number,
    password: string | number
}

interface INewUser extends IUser{
    app_id: string,
    app_key: string,
    app_name: string
}
interface IUserListItem extends INewUser {
    user_id: number
}
/** 登录
 * user_name
 * pass_word
 */
export const loginApi = (data: IUser) => PostJson('/login', data)


/** 添加新用户
 */
export const addUserApi = (data: INewUser) => PostJson('/add/new_user', data)

/** 更新用户信息 */
export const updateUserApi = (data: INewUser) => PostJson('/update/user_info', data)


/** 获取用户列表
 * user_anem
 */
export const getUserList = (data: any): Promise<IUserListItem[]> => PostJson('/get/user_info', data)

/** 添加翻译信息反馈 */
export const feedBackApi = (data: any) => PostJson('/add/trans/feed_back', data)

/** 查询错误信息列表 */
export const getErrorTypeApi = () => Get('/get/trans/error_type')

/** 翻译 */
export const translateApi = (data: any) => PostJson('/translate', data)

